package cn.detu.uu;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

public class Test6 {
    public static void main(String[] args) throws IOException {

        File file = new File("D:\\java\\1.txt");

        //System.out.println(file.length());
        //System.out.println(file.exists());
        //System.out.println(file.isFile());
        //System.out.println(file.isDirectory());
        //System.out.println(file.getName());
        //System.out.println(file.getParent());
        //System.out.println(file.getAbsolutePath());
        // file = new File("D:\\java\\3.txt");
        // System.out.println(file.createNewFile());//创建不存在的文件
        //file = new File("D:\\java\\abc");
        // System.out.println(file.mkdir());
        //file = new File(("D:\\java\\m\\n\\x"));
        //System.out.println(file.mkdirs());
        //file = new File("F:\\java\\3.txt");
        //System.out.println(file.delete());
        file = new File("D:\\java");
        String[] names = file.list();//获取所有资源的名字
        System.out.println(Arrays.toString(names));
        System.out.println(file.listFiles());
        File[] fs = file.listFiles();
        System.out.println(Arrays.toString(fs));
        File file1 = new File("D:\\java\\10.txt");
        File file2 = new File("D:\\java\\60.txt");
        File file3 = new File("D:\\java\\50.txt");
        File[] a =new File[3];
        a[0] = file1;
        a[1] = file2;
        a[2] = file3;
        File[] ds = file1.listFiles();
        File[] ds1 = file2.listFiles();
        File[] ds2 = file3.listFiles();
        System.out.println(Arrays.toString(a));
    }
}
